@import '../../styles/common.scss';

.sidebar {
  position: relative;
  // display: none;
  flex: 1;
  min-width: 260px;
  height: 100%;
  border-right: 2px solid #ccc;

  .sidebar-inner {
    position: absolute;
    top: 0;
    bottom: 80px;
    right: 0;
    left: 0;
    overflow-y: auto;

    &.no-tab {
      padding-top: 8px;
      overflow-x: hidden;
    }
  }

  .no-data {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #aaa;
  }

  .sidebar-macros {
    .untitled {
      display: flex;
      flex-direction: row;
      align-items: center;
      padding: 5px 10px;
      font-size: 14px;

      &.selected {
        background:  $bgSelected;
      }

      .icon-wrapper {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        margin-right: 5px;
        width: 20px;

        .file-icon {
          display: block;
          height: 16px;
        }
      }
    }
  }


  .test-case-actions,
  .test-suite-actions {
    padding: 0 10px 10px;

    button {
      margin-right: 10px;
    }
  }

  .test-case-actions {
    display: flex;
    padding-bottom: 0;
  }

  .sidebar-test-suites {
    .test-suite-item {
      padding: 0 0 10px 0;
      margin-bottom: 5px;

      &.playing {
        background: $bgSelected;
      }

      &.fold {
        margin-bottom: 0;
        padding-bottom: 0;

        .test-suite-more-actions,
        .test-suite-cases {
          display: none;
        }
      }

      .test-suite-row {
        padding: 5px 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;

        .test-suite-title {
          flex: 1;
          margin-left: 10px;
        }

        .more-button {
          display: none;
        }

        &:hover .more-button {
          display: block;
        }
      }

      .test-suite-cases {
        padding: 3px 5px;

        li {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 3px 5px 3px 20px;
          margin-bottom: 5px;

          &.done-tc {
            @include bgColorWithBlur($bgSuccess);
          }

          &.error-tc {
            @include bgColorWithBlur($bgError);
          }

          &.current-tc {
            @include bgColorWithBlur($bgRunning);
          }
        }
      }

      .test-suite-more-actions {
        padding-left: 27px;
      }
    }
  }

  .sidebar-storage-mode {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    padding: 0 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    .storage-mode-header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 5px;
      font-size: 12px;
      margin: 0 0 0 7px;

      h3 {
        font-size: 14px;
      }
    }
  }

  .ant-tabs {
    min-height: 100%;
  }

  .ant-tabs-bar {
    border-bottom: 2px solid #ccc;
  }

  .ant-tabs-nav-container-scrolling {
    padding-left: 0;
    padding-right: 0;
  }

  .ant-tabs-tab-prev.ant-tabs-tab-arrow-show,
  .ant-tabs-tab-next.ant-tabs-tab-arrow-show {
    display: none;
  }

  .ant-tabs-nav {
    height: 44px;
  }

  .ant-tabs-nav .ant-tabs-tab {
    margin-right: 0;
    line-height: 27px;
  }

  .ant-tabs-nav-scroll {
    text-align: center;
  }

  .resize-handler {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ccc;
    cursor: col-resize;

    &:hover, &.focused {
      right: -4px;
      width: 6px;
      background: #aaa;
    }
  }

  &.with-xmodules-note {
    .sidebar-inner {
      bottom: 160px;
    }

    .sidebar-storage-mode {
      height: 160px;
    }

    .note-for-macros {
      margin-bottom: 20px;
      padding: 10px 10px 0;
      border-top: 1px solid #333;
      font-size: 12px;
    }
  }
}

.with-sidebar .sidebar {
  display: block;
}

.context-menu {
  z-index: 10;

  .ant-menu {
    border: '1px solid #ccc';
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);

    .ant-menu-item {
      height: 36px;
      line-height: 36px;

      &:hover {
        background: #ecf6fd;
      }
    }
  }
}

.xfile-not-installed-modal {

  &.left-bottom {
    position: absolute;
    top: auto !important;
    bottom: 100px;
    left: 100px;
  }

  p {
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: bold;
  }
}

.macros-dropdown {
  width: auto !important;
}
